#include "myworld.h"
#include <cstdlib>    
#include <GL/glut.h>
#include <iostream>

myWorld::myWorld(const Rectangle boundary) :
    World(boundary)
{
}

void myWorld::Draw()
{
    /*
    // Drawing Visualization Grid //
    glLineWidth(0.25);
    glColor3f(0.7,0.7,0.7);
    double grid = GetGrid();
    //double gridY = GetGridFactor().GetY();

    glBegin(GL_LINES);
    for(double i = GetBoundary().GetLeft(); i < GetBoundary().GetRight(); i += grid)
    {
        glVertex2f(i, GetBoundary().GetBottom());
        glVertex2f(i, GetBoundary().GetTop());
    }

    for(double i = GetBoundary().GetBottom(); i < GetBoundary().GetRight(); i += grid)
    {
        glVertex2f(GetBoundary().GetLeft(), i);
        glVertex2f(GetBoundary().GetRight(), i);
    }

    glEnd();*/

    World::Draw();
}

#ifdef BEND2D_DEBUG
void myWorld::DrawNew()
{
    /*for(CollideRegion::CollideRegionMap::iterator it = GetRegions().begin(); it != GetRegions().end(); ++it)
    {
        if(it->second.GetObjects().size() > 1)
        {
            glLineWidth(2.0);
            glColor3f(0,0.5,0);
    
            if(it->second.GetObjects().size() > 1)
                glColor3f(1,0,0);

            Rectangle rect = it->second.GetRegionRect();

            glBegin(GL_LINE_LOOP);
            glVertex2f(rect.GetLeft(), rect.GetTop());
            glVertex2f(rect.GetRight(), rect.GetTop());
            glVertex2f(rect.GetRight(), rect.GetBottom());
            glVertex2f(rect.GetLeft(), rect.GetBottom());

            glEnd();
        }
    }*/

    World::DrawNew();
}
#endif
